<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBookIsbnsTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('book_isbns', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('isbn10');
			$table->bigInteger('isbn13');
			$table->string('title', 100);
			$table->string('author', 50);
			$table->string('pubdate', 50)->comment('出版年');
			$table->string('publisher', 50)->comment('出版社');
			$table->string('image', 100);
			$table->string('binding', 50);
			$table->integer('pages');
			$table->string('douban_url', 200);
			$table->text('author_intro')->commnet('作者简介');
			$table->decimal('price');
			$table->timestamps();
			$table->unique('isbn10');
			$table->unique('isbn13');
			$table->index(['title']);
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::dropIfExists('book_isbns');
	}
}
